import request from "@/utils/request";

const api = '/channel-domain/'

/**
 *  投放渠道
 * **/
// 添加渠道链接
export async function addChannelLink(params) {
    return await request.post(api + 'channel/addChannelLink', params)
}

// 添加投放
export async function addDistributor(params) {
    return await request.post(api + 'channel/addDistributor', params)
}

// 渠道链接列表
export async function fetchChannelLinkList(params) {
    return await request.get(api + 'channel/selectByDistributorPage', {params})
}

// 渠道可用产品名称
export async function selectChannelProduct(params) {
    return await request.get(api + 'channel/selectChannelProduct', {params})
}

// 投放渠道链接数据统计
export async function selectCodeStatistical(params) {
    return await request.get(api + 'channel/selectCodeStatistical', {params})
}

// 投放渠道链接数据统计按日期分组
export async function selectCodeStatisticalDate(params) {
    return await request.get(api + 'channel/selectCodeStatisticalDate', {params})
}

// 投放列表
export async function fetchDistributorList(params) {
    return await request.get(api + 'channel/selectDistributorPage', {params})
}

// 投放公司
export async function selectCompany(params) {
    return await request.get(api + 'channel/selectName', {params})
}

// 投放公司数据统计
export async function selectStatistical(params) {
    return await request.get(api + 'channel/selectStatistical', {params})
}

// 投放公司按日期统计
export async function selectStatisticalDate(params) {
    return await request.get(api + 'channel/selectStatisticalDate', {params})
}

// 修改投放商信息
export async function updateDistributor(params) {
    return await request.post(api + 'channel/updateDistributor', params)
}

// 修改渠道链接
export async function updateLinkStatus(params) {
    return await request.post(api + 'channel/updateLinkStatus', params)
}

// 重置密码
export async function updatePassword(params) {
    return await request.post(api + 'channel/updatePassword', params)
}

// 修改投放商状态
export async function updateStatus(params) {
    return await request.post(api + 'channel/updateStatus', params)
}

/**
 *  白名单
 * **/
// 白名单渠道添加
export async function addChannel(params) {
    return await request.post(api + 'whitelist/addChannel', params)
}

// 白名单交易添加
export async function addRecent(params) {
    return await request.post(api + 'whitelist/addRecent', params)
}

// 白名单导入
export async function addWhiteListCsv(params) {
    return await request.post(api + 'whitelist/addWhiteListCsv', params)
}

// 是否可以添加白名单交易
export async function isAddRecent(params) {
    return await request.get(api + 'whitelist/isAddRecent', {params})
}

// 获取渠道下拉
export async function selectChannelName(params) {
    return await request.get(api + 'whitelist/selectChannelName', {params})
}

//白名单渠道列表
export async function fetchChannelList(params) {
    return await request.get(api + 'whitelist/selectChannelPage', {params})
}

//白名单交易列表
export async function fetchRecentList(params) {
    return await request.get(api + 'whitelist/selectRecentPage', {params})
}

//白名单交易放款
export async function fetchRecentPayment(params) {
    return await request.get(api + 'whitelist/selectRecentPayment', {params})
}

//白名单交易还款
export async function fetchRecentRefund(params) {
    return await request.get(api + 'whitelist/selectRecentRefund', {params})
}

//白名单查重复
export async function selectRepeatWhitelist(params) {
    return await request.post(api + 'whitelist/selectRepeatWhitelist', params,{responseType: 'blob'})
}

//白名单列表
export async function fetchWhitelistList(params) {
    return await request.get(api + 'whitelist/selectWhitelistPage', {params})
}

//白名单交易修改单价
export async function updateRecent(params) {
    return await request.post(api + 'whitelist/updateRecent', params)
}
